﻿<Window 
	x:Class="Sidvall.UI.Wpf.MainWindow"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:b="clr-namespace:Sidvall.UI.Wpf.Controls;assembly=Sidvall.UI.Wpf"
	xmlns:Converters="clr-namespace:Sidvall.UI.Wpf.Converters;assembly=Sidvall.UI.Wpf" 
	Title="Template Application" Height="400" Width="600" Closing="Window_Closing" WindowStartupLocation="CenterScreen">

	<Window.Resources>
		<Converters:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
		<Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
		<b:BusyIndicatorControl x:Key="BusyIndicatorControl" />
	</Window.Resources>

	<Grid>
		<b:BusyIndicatorControl HeaderCaption="LOADING..." Visibility="{Binding IsBusyAndStarted, Converter={StaticResource BooleanToVisibilityConverter}}" Panel.ZIndex="10" />
		<Grid>
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto" />
				<RowDefinition />
				<RowDefinition Height="Auto" />
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" />
				<ColumnDefinition />
				<ColumnDefinition Width="Auto" />
			</Grid.ColumnDefinitions>

			<ContentControl Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" x:Name="HeaderContent" IsEnabled="{Binding IsNotBusyAndStarted}" />

			<ContentControl Grid.Row="1" Grid.Column="0" x:Name="LeftContent" IsEnabled="{Binding IsNotBusyAndStarted}" />
			<ContentControl Grid.Row="1" Grid.Column="1" x:Name="CenterContent" IsEnabled="{Binding IsNotBusyAndStarted}" />
			<ContentControl Grid.Row="1" Grid.Column="2" x:Name="RightContent" IsEnabled="{Binding IsNotBusyAndStarted}" />

			<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" x:Name="FooterContent" IsEnabled="{Binding IsNotBusyAndStarted}" />
		</Grid>
	</Grid>
</Window>
